import React from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';
import { GlobalStyle } from './style';
import { IconFont } from './statics/iconfont/iconfont';
import Header from './common/header';
import Home from './pages/home';
import Detail from './pages/detail/loadable';
import login from './pages/login';
import write from './pages/write';
import store from './store';

function App() {
  return (
    <div>
      <GlobalStyle />
      <IconFont />
      <Provider store={store}>        
        <BrowserRouter>  
          <Header /> 
          <Route path='/' exact component={Home}></Route>        
          <Route path='/login' exact component={login}></Route>
          <Route path='/detail/:id' exact component={Detail}></Route>      
          <Route path='/write' exact component={write}></Route>    
        </BrowserRouter>
      </Provider>        
    </div>
  );
}

export default App;
